﻿

Public Class CtlItemPowerShow
    Inherits TabPage

    Private gridResult As DataGridView
    Friend WithEvents colNetName As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colLostPower As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colReStartTime As System.Windows.Forms.DataGridViewTextBoxColumn

    Public Sub New(ByVal strName As String, ByVal lst As IList(Of DeviceRestartTime))
        MyBase.New(strName)
        Initialize()
        gridResult.AutoGenerateColumns = False
        gridResult.DataSource = lst
    End Sub

    Private Sub Initialize()
        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Me.gridResult = New System.Windows.Forms.DataGridView
        Me.colNetName = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colLostPower = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colReStartTime = New System.Windows.Forms.DataGridViewTextBoxColumn


        CType(Me.gridResult, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()

        Me.gridResult.AllowUserToAddRows = False
        Me.gridResult.AllowUserToDeleteRows = False
        DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
        DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control
        DataGridViewCellStyle1.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText
        DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight
        DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText
        DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
        Me.gridResult.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1
        Me.gridResult.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
        Me.gridResult.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colNetName, Me.colLostPower, Me.colReStartTime})
        Me.gridResult.Dock = System.Windows.Forms.DockStyle.Fill
        Me.gridResult.Location = New System.Drawing.Point(224, 0)
        Me.gridResult.Name = "gridResult"
        Me.gridResult.ReadOnly = True
        Me.gridResult.RowTemplate.Height = 23
        Me.gridResult.Size = New System.Drawing.Size(568, 477)
        Me.gridResult.TabIndex = 1
        '
        'colNetName
        '
        Me.colNetName.DataPropertyName = "Name"
        DataGridViewCellStyle2.Format = "#.#"
        Me.colNetName.DefaultCellStyle = DataGridViewCellStyle2
        Me.colNetName.HeaderText = "设备名称"
        Me.colNetName.Name = "colNetName"
        Me.colNetName.ReadOnly = True
        Me.colNetName.Width = 120
        '
        'colLostPower
        '
        Me.colLostPower.DataPropertyName = "LastTime"
        Me.colLostPower.HeaderText = "断电时间"
        Me.colLostPower.Name = "colLostPower"
        Me.colLostPower.DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss"
        Me.colLostPower.ReadOnly = True
        Me.colLostPower.Width = 120
        '
        'colReStartTime
        '
        Me.colReStartTime.DataPropertyName = "RestartedTime"
        Me.colReStartTime.HeaderText = "启动时间"
        Me.colReStartTime.Name = "colReStartTime"
        Me.colReStartTime.DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss"
        Me.colReStartTime.ReadOnly = True
        Me.colReStartTime.Width = 120

        Me.Controls.Add(Me.gridResult)
        CType(Me.gridResult, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
    End Sub
    
End Class
